package com.example.nna.voz;

import java.util.ArrayList;

import android.graphics.Bitmap;

import com.example.nna.util.spanable;

public class containPage3 {
	private String tContain;
	private String mUser;
	private String mTime;
	private String mUrlAvatar;
	private String m_id;
	private Bitmap mAvatar;
	private String mTitle;
	spanable quote;
	spanable border;
	spanable img;
	spanable web;
	spanable size;
	bitmapSpan image;
	fontSpan font;
	typeSpan type;
	spanable typeU;
	private ArrayList<Bitmap> bitmaps;
	public int style;
	private boolean isMultiQuote;
	public containPage3(){
		tContain = new String();
		img = new spanable();
		web = new spanable();
		bitmaps = new ArrayList<Bitmap>();
		image = new bitmapSpan();
		font = new fontSpan();
		type = new typeSpan();
		typeU = new spanable();
		quote = new spanable();
		isMultiQuote = false;
	}
	public void setTitle(String value){
		mTitle = value;
	}
	public String title(){
		return mTitle;
	}
	public void setMultiQuote(boolean value){
		isMultiQuote = value;
	}
	public boolean isMultiQuote(){
		return isMultiQuote;
	}
	public boolean isEmpty(){
		for(int i=0;i<tContain.length();i++){
			if(tContain.codePointAt(i) != 32) return false;
		}
		if((bitmaps.size()==0)) return true;
		else return false;
	}
	public void set(String text,ArrayList<Bitmap> bitmap){
		tContain = text;
		bitmaps = bitmap;
	}
	public void addText(String text){
		tContain += text;
	}
	public String getText(){
		return tContain;
	}
	public void Info(String mUser,String mTime, Bitmap mAvatar,String mUrlAvatar){
		this.mUser = mUser;
		this.mTime = mTime;
		this.mAvatar = mAvatar;
		this.mUrlAvatar = mUrlAvatar;

	}
	public void setId(String m_id){
		this.m_id = m_id;
	}
	public String Id(){
		return m_id;
	}
	public String User(){
		return mUser;
	}
	public String Time(){
		return mTime;
	}
	public Bitmap Avatar(){
		return mAvatar;
	}
	public void setAvatar(Bitmap bitmap){
		this.mAvatar = bitmap;
	}
	public String UrlAvatar(){
		return mUrlAvatar;
	}
	public class typeSpan extends spanable{
		private int type;
		public void add(String str, int start, int end,int type){
			super.add(str, start, end);
			this.type = type;
		}
		public int type(){
			return type;
		}
	}
	public class fontSpan extends spanable{
		private ArrayList<String> color = new ArrayList<String>();
		private ArrayList<Integer> size = new ArrayList<Integer>();
		@Override
		public void add(String str, int start, int end) {
			// TODO Auto-generated method stub
			super.add(str, start, end);
		}
		public void add(String str, int start, int end,String mcolor,int msize){
			super.add(str, start, end);
			color.add(mcolor);
			size.add(msize);
		}
		public String color(int index){
			return color.get(index);
		}
		public int size(int index){
			return size.get(index);
		}
	}
	
	public class bitmapSpan extends spanable{
		ArrayList<Bitmap> bitmaps;
		public bitmapSpan(){
			bitmaps = new ArrayList<Bitmap>();
		}
		public void add(String str, int start, int end,Bitmap bitmap) {
			// TODO Auto-generated method stub
			super.add(str, start, end);
			this.bitmaps.add(bitmap);
		}
		public void addBitmap(Bitmap bitmap){
			bitmaps.add(bitmap);
		}
		public ArrayList<Bitmap> getBitmap(){
			return bitmaps;
		}
		public Bitmap getBitmap(int index){
			return bitmaps.get(index);
		}
		public int sizeBitmap(){
			return bitmaps.size();
		}
		public void SetBitmap(int i,Bitmap bitmap){
			bitmaps.set(i, bitmap);
		}
		
	}
}
